/*
 * File Name：PayStatus.java
 * Copyright：Copyright 2008-2014 CiWong.Inc. All Rights Reserved.
 * Description： PayStatus.java
 * Modify By：jejun
 * Modify Date：2014-6-12
 * Modify Type：Add
 */
package com.ciwong.mobilepay.view;

import android.content.Context;
import android.graphics.Color;
import android.util.DisplayMetrics;
import android.util.TypedValue;
import android.widget.FrameLayout;
import android.widget.LinearLayout;

/**
 * 支付状态
 * 
 * @author jejun
 * @version ciwong v.1.0 2014-6-12
 * @since ciwong v.1.0
 */
public class PayStatus extends LinearLayout
{
    public static final int payResult = 0x2f1;

    public static final int payAdvertisement = 0x2f1;

    public PayStatus(Context context)
    {
        super(context);
        init();
    }

    private void init()
    {
        setLayoutParams(new LayoutParams(LayoutParams.FILL_PARENT,
                LayoutParams.FILL_PARENT));
        setOrientation(VERTICAL);

        TitleBar tb = new TitleBar(getContext());
        addView(tb);
        setBackgroundColor(Color.WHITE);


        FrameLayout payResult = new FrameLayout(getContext());
        payResult.setId(PayStatus.payResult);
        LayoutParams lp = new LayoutParams(LayoutParams.FILL_PARENT, 0, 1.0f);
        addView(payResult);

        DisplayMetrics dm = getResources().getDisplayMetrics();
        int padding = (int) TypedValue.applyDimension(
                TypedValue.COMPLEX_UNIT_DIP, 18, dm);
        payResult.setLayoutParams(lp);

        payResult.setPadding(padding, padding, padding, padding);

        FrameLayout payAdvertisement = new FrameLayout(getContext());
        payAdvertisement.setId(PayStatus.payAdvertisement);
        lp = new LayoutParams(LayoutParams.FILL_PARENT, 0, 1.5f);
        addView(payAdvertisement);
        payAdvertisement.setLayoutParams(lp);

    }
}
